<html>
<head>
	<title>Excersise 6</title>
	<link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console"></div>
	<script src="scripts/js-console.js"></script>
	<script>
	var numbers = new Array(5, 7, 5, 5, 6, 7, 11, 6, 7, 7);
	var currentElement = 0;
    var mostFreqEl = 0;
    var currentIndex = 0;
	for (i = 0; i < 10; i++)
        {
        currentEl = 1;
        for (j = 0; j < 10; j++)
            {
                if (numbers[i] == numbers[j])
                {
                    currentEl++;
                }
            }
            currentEl--;
            if (currentEl > mostFreqEl)
            {
                mostFreqEl = currentEl;
                currentIndex = i;
            }
        }
		jsConsole.writeLine("The number " + numbers[currentIndex] + " is most frequent - " + mostFreqEl + " times");
		for (k=0;k<numbers.length;k++)
		{
			jsConsole.write(numbers[k] + " ");
		}
	</script>
</body>
</html>
